﻿using Nop.Core.Domain.Orders;
using Nop.Core.Domain.Payments;
using Nop.Core.Domain.Shipping;
using Nop.Web.Framework.Models;
using Nop.Web.Models.Common;
using Nop.Web.Models.Media;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Nop.Web.Models.Order
{
    public class OrderDetailsModel2 : BaseNopEntityModel
    {
       
        public string CustomOrderNumber { get; set; }
        public decimal OrderTotal { get; set; }
        public OrderStatus OrderStatus { get; set; }
        public PaymentStatus PaymentStatus { get; set; }
        public ShippingStatus ShippingStatus { get; set; }
        public DateTime CreatedOn { get; set; }
        public string ShippingMethod { get; set; }
        public AddressModel ShippingAddress { get; set; } = new AddressModel();
        public IList<ShipmentBriefModel> Shipments { get; set; } = new List<ShipmentBriefModel>();

        public IList<OrderDetailsModel2.OrderItemModel> Items { get; set; } = new List<OrderItemModel>();
        public IList<OrderDetailsModel2.OrderNote> OrderNotes { get; set; } = new List<OrderNote>();
        public string PayOrderId { get; set; }
        public IList<KeyValuePair<int, int>> ReviewsCount { get;   set; }

        public partial class OrderNote : BaseNopEntityModel
        {
            public string Note { get; set; }
            public DateTime CreatedOn { get; set; }
        }

        public partial class OrderItemModel : BaseNopEntityModel
        {

            public int ProductId { get; set; }
            public string ProductName { get; set; }

            public decimal UnitPrice { get; set; }
            public decimal SubTotal { get; set; }
            public int Quantity { get; set; }
            public string AttributeInfo { get; set; }
            public string RentalInfo { get; set; }
            public PictureModel DefaultPicture { get; set; } = new PictureModel();
        }


        public partial class ShipmentBriefModel : BaseNopEntityModel
        {

            public string TrackingNumber { get; set; }
            public DateTime? ShippedDate { get; set; }
            public DateTime? DeliveryDate { get; set; }


            public IList<OrderDetailsModel2.ShipmentStatusEventModel> ShipmentStatusEvents { get; set; } = new List<ShipmentStatusEventModel>();
        }

        public class ShipmentStatusEventModel : BaseNopEntityModel
        {
            public DateTime? Date { get; set; }
            public string EventName { get; set; }
        }
    }
}
